/*
	FileName : GF_WFL_PI.h
	Description :
	Created on 2017.12.09 by WFL.

	Revision History:

*/



#ifndef  __GF_WFL_PI_20180413__
#define  __GF_WFL_PI_20180413__
//------------------------------------------------------------------------------

/*
 * For defenition of uint8_t/uint16_t/uint32_t/
 */
#include "stdint.h"

//-----------------------------------------------------------------------------
/*
 * LittleEndian, memory get 32bit.
 */
uint32_t Mem_LE_Get32(uint8_t *bufAddr, uint16_t offset);
/*
 * LittleEndian, memory set 32bit.
 */
void Mem_LE_Set32(uint8_t *bufAddr, uint16_t offset, uint32_t val);
/*
 * LittleEndian, memory get 16bit.
 */
uint16_t Mem_LE_Get16(uint8_t *bufAddr, uint16_t offset);
/*
 * Big Endian, memory get 16bit.
 */
uint16_t Mem_BE_Get16(uint8_t *bufAddr, uint16_t offset);
/*
 * LittleEndian, memory set 16bit.
 */
void Mem_LE_Set16(uint8_t *bufAddr, uint16_t offset, uint16_t val);
/*
 * Big Endian, memory set 16bit.
 */
void Mem_BE_Set16(uint8_t *bufAddr, uint16_t offset, uint16_t val);
/*
 * LittleEndian, memory get 8bit.
 */
uint8_t Mem_LE_Get8(uint8_t *bufAddr, uint16_t offset);
/*
 * LittleEndian, memory set 8bit.
 */
void Mem_LE_Set8(uint8_t *bufAddr, uint16_t offset, uint8_t val);

uint8_t Mem_8b_Hbits(uint8_t *bufAddr, uint16_t offset, uint8_t bit);

void Mem_8b_setAll(uint8_t *bufAddr,uint32_t offset,uint32_t len,uint8_t val);
uint16_t Mem_16b_getAverage(uint16_t *bufAddr,uint16_t number);
//------------------------------Buffer GF-----------------------------------------------------
uint32_t Buf_index_add(uint32_t start,uint32_t size,uint32_t index,uint32_t quantity);

void Buf_8b_copy(uint8_t *srcbuf,uint32_t size,uint32_t offset,uint8_t *dstBuf,uint32_t len);

uint32_t Sec_get_leftCn(uint32_t size,uint32_t offset,uint32_t secSize);




//------------------------------------------------------------------------------
#endif

///EOF


